<?php
$dbhost = 'localhost';  // mysql服务器主机地址
$dbuser = 'ether_gq';            // mysql用户名
$dbpass = '8MN6ZYmayNbRwxm7';          // mysql用户名密码
$dbname = 'ether_gq';
$conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);

$a='SELECT username FROM user WHERE username like "%'.$_GET["username"].'%"';
$sql=mysqli_query($conn,$a);

$usernames=array("usernames"=>array());

while ($row = mysqli_fetch_array($sql)){
    array_push($usernames['usernames'],$row[0]);
};

$usernames=json_encode($usernames);

echo $usernames;

mysqli_close($conn);

?>